Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-polyfill-regenerator

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-polyfill-regenerator

A Babel plugin to inject imports to regenerator-runtime

  • 0.5.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24M
increased by1.61%
Maintainers
1
Weekly downloads
 
Created

What is babel-plugin-polyfill-regenerator?

The babel-plugin-polyfill-regenerator package is designed to automatically replace `regeneratorRuntime` references with the corresponding polyfill from the `regenerator-runtime` package. This is particularly useful when using async/await or generator functions in environments that do not natively support these features. By including this plugin in your Babel configuration, you can ensure that your code will run correctly in older browsers or environments without needing to manually import or include the regenerator runtime in your source code.

What are babel-plugin-polyfill-regenerator's main functionalities?

Automatic Polyfill Injection for Async/Await

This feature automatically detects usage of async/await syntax in your JavaScript code and injects the necessary regenerator runtime polyfill to ensure compatibility with environments that do not natively support async/await. This is done without any manual imports or code modifications.

"use strict";\n\nasync function foo() {\n  await bar();\n}\n

Automatic Polyfill Injection for Generator Functions

Similar to the async/await feature, this functionality automatically detects the use of generator functions in your code. It then ensures that the necessary regenerator runtime polyfill is included, allowing these functions to work in environments that do not support generators natively.

"use strict";\n\nfunction* myGenerator() {\n  yield 1;\n  yield 2;\n}\n

Other packages similar to babel-plugin-polyfill-regenerator

Keywords

FAQs

Package last updated on 18 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc